#include <bitset>
#include <iostream>

template <unsigned N>
class quiz {
  template <unsigned M>
  friend std::ostream &operator<<(std::ostream &, const quiz<M> &);

 public:
  quiz(std::string &s) : bset(s) {}
  void update(size_t n, bool b) { bset[n] = b; }

 private:
  std::bitset<N> bset;
};

template <unsigned M>
std::ostream &operator<<(std::ostream &os, const quiz<M> &q) {
  os << q.bset;
  return os;
}

int main() {
  std::string s1("0101010101");
  std::string s2(
      "010101010101010101010101010101010101010101010101010101010101010101010101"
      "0101010101010101010101010101");
  quiz<10> q1(s1);
  quiz<100> q2(s2);

  q1.update(1, true);
  std::cout << q1 << std::endl;

  return 0;
}